Skip to content

Fixes #4249 - isGuestAccount : return nil on invalid input #4312

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

MohabCodeX
Copy link
Contributor

Fixes #4249

@botder botder added the backwards-incompatible Should be merged after the release of 1.7.1 label Jul 26, 2025
@FileEX
Copy link
Member

FileEX commented Jul 27, 2025

This isn't really backwards-incompatible, because false and nil are handled the same way in Lua, typically with

if (not something) then

So existing code will still behave the same. The chance that anyone did something like:

local b = isGuestAccount(acc)
if (type(b) == 'boolean') then

...is minimal

@jjustns
Copy link
Contributor

jjustns commented Jul 28, 2025

So existing code will still behave the same. The chance that anyone did something like:

local b = isGuestAccount(acc)
if (type(b) == 'boolean') then

...is minimal

I've seen cases of where people will do something like;

local b = isGuestAccount(acc)
if  b == false then

So the backwards incompatibility does apply here.

@botder
Copy link
Member

botder commented Aug 1, 2025

Thanks for this pull request, but even with the upcoming 1.7 release, I don't think we should touch the return value. It's just not worth it, for correctness sake.

@botder botder closed this Aug 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backwards-incompatible Should be merged after the release of 1.7.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

isGuestAccount will return false for values that aren't accounts
5 participants